================================================

1. Chapter Head -Body

~DBSEEK{|TariffMaster|,|Tariff|,|=|,Itemmaster.tariff,|ChapterHead|}

---------------------------------------------------------------------
2. Consignee

~DBSEEK{|Master|,|Code|,|=|,Sales.DelyCode,|Name|}

---------------------------------------------------------------------
3. Stock Serial No:

~OpenRs{|Stockserial|,|Type='|Stock.Type|' And Prefix='|Stock.Prefix|' And Srl='|Stock.Srl|' And Sno='|Stock.Sno|'|,|Reference|}
----------------------------------------------------------------------
4. Running Balance

 Sales.RunBal
----------------------------------------------------------------------

5. Loan Ledger

col.No:9---->Co.field = ~round{~Col{8},0}

col.No:9---->Co.field = ~iif{~Col{9}<5000,0,~Col{9}*10.2/100}

col.No:9---->Co.field = ~Col{9}+~Col{10}
-----------------------------------------------------------------------

6.Chapter Head-Head
~DBSEEK{|Tariffmaster|,|Tariff|,|=|,~DBSEEK{|Itemmaster|,|Code|,|=|,Stock.code,|Tariff|},|ChapterHead|}

------------------------------------------------------------------------

7.Delivery Schedule

~OpenRs{|DlySchedule|,|Type='|Ordersstk.Type|' And Prefix='|Ordersstk.Prefix|' And Srl='|Ordersstk.Srl|' And Sno='|Ordersstk.Sno|' Order By DlyDate|,|DlyDate|}
~OpenRs{|DlySchedule|,|Type='|Ordersstk.Type|' And Prefix='|Ordersstk.Prefix|' And Srl='|Ordersstk.Srl|' And Sno='|Ordersstk.Sno|' Order By DlyDate|,|Qty|}

------------------------------------------------------------------------

8. Broker

~DBSEEK{|Broker|,|Code|,|=|,Sales.Broker,|Name|}

------------------------------------------------------------------------

9. Salesman

~DBSEEK{|Salesman|,|Code|,|=|,Sales.Salesman,|Name|}
------------------------------------------------------------------------

10.Party Local Sales Tax Number.

~dbseek{|Address|,|code|,|=|,sales.code,|LstNo|}

-------------------------------------------------------------------------

11.Party Centreal Tax Number

~dbseek{|Address|,|code|,|=|,sales.code,|CstNo|}

--------------------------------------------------------------------------

12.Alternate Address.

~ALTADDRESS{Sales.Code,Sales.AltAddress}

--------------------------------------------------------------------------

13.Tax Description IN DOC PRINT

~DBSEEK{|TaxMaster|,|Code+SCOPE|,|=|,Sales.TaxCode|S|,|Name|}

--------------------------------------------------------------------------
14. Invoice Printing with group name

Format Setup in Order by Write : Stock.Grp

Equation = Stock.Grp
Condition = NEWGROUP=|True|
SpaceSaver = True
--------------------------------------------------------------------------

15.Batch Number

~DBSEEK{|stock|,|type+prefix+srl+sno|,|=|,stock.type+stock.prefix+stock.srl+stock.sno,|batch|}

------------------------------------------------------------------------------------

16.Multiple Tax Code

~DBSEEK{|taxmaster|,|code|,|=|,sock.taxcode,|pct|}

----------------------------------------------------------------------------------

17.order Number in sales

~DBSEEK{|SalesOrder|,|Code|,|=|,Sales.code,|SalesOrder.OrdNumber|}

----------------------------------------------------------------------------------

18. MRP in Purchase Register with Stock Detail

~DBSEEK{|itemdetail|,|code|,|=|,~Col{9},|MRP|}

----------------------------------------------------------------------------------

19.Login Signature in Design Format.

   Tfatpass.signature

-------------------------------------------------------------------------------------

21.DueDays in Analysis-Outstanding(without Ref.)
    Col8 Field---DateAdd('d',CrPeriod,Docdate)
    Col9 Field---~DatLess{~RepDateTo{},~Col{8}} / Calcol---~Col{8}<>||

---------------------------------------------------------

22.BatchNumber in StockRegister
  ~DbSeek{|StockBatch|,|Type+Prefix+Sno+Srl|,|=|,~Col{2}~Col{3}~Col{5}~Col{4},|Batch|}

---------------------------------------------------------

23.Tds Cut-True/False Flag in LnLedger Summary
   ~DBSEEK{|MASTER|,|NAME|,|=|,~COL{1},|CUTTDS|}

---------------------------------------------------------

24.Alt.Address Lst Number
   ~Dbseek{|Address|,|Code+ltrim(rtrim(str(sno)))|,|=|,Sales.code+sales.AltAddress,|LSTNo|}

--------------------------------------------------------- 

25.FORM PENDING SALES/PURCHASE REGISTER

~DBSEEK{|Master|,|Master.Name|,|=|,~Col{4},|Code|}
~DBSEEK{|sales|,|sales.prefix+sales.srl+Sales.code|,|=|,~Col{1}~Col{2}~col{7},|amt|}
~DBSEEK{|Purchase|,|Purchase.prefix+Purchase.srl+Purchase.code|,|=|,~Col{1}~Col{2}~col{7},|amt|}

-------------------------------------------------------------

26.LOAN LEDGER SUMMARY

~DBSEEK{|Master|,|Master.Name|,|=|,~Col{1},|tdsCode|}            
~DBSEEK{|TdsMaster|,|TdsMaster.code|,|=|,~Col{12},|LimitFrom|}
~DBSEEK{|TdsMaster|,|TdsMaster.code|,|=|,~Col{12},|tax|}
~round{~iif{~Col{9}<~col{13},0,~col{9}*~col{14}/100},2}
~DBSEEK{|Master|,|Master.Name|,|=|,~Col{1},|CutTDS|}

--------------------------------------------------------------

27.Trading Excise(Don't use)
Detail of Suppliers Name in Trading Excise
1.~DBGOTOP{|Stock|}
2.~OpenRs{|Exciseinfo|,|Type='|StockOs.aType|' And Prefix='|StockOs.aPrefix|' And Srl='|StockOs.aSerial|' And Sno='|StockOs.aSno|' and Excstage=2|}
3. Stock:~OpenRs{|StockOs|,|Type='|Stock.Type|' And Prefix='|Stock.Prefix|' And Srl='|Stock.Srl|' And Sno='|Stock.Sno|'|}
4. Master Name: ExciseInfo.Name
Above master fld 1,2,3

Detail of mfg./imp.Name in Trading Excise
1.~OpenRs{|Exciseinfo|,|Type='|StockOs.aType|' And Prefix='|StockOs.aPrefix|' And Srl='|StockOs.aSerial|' And Sno='|StockOs.aSno|' and Excstage=1|}
2. Master Name:ExciseInfo.Name
Above master fld 1

------------------------------------------------------------------------------

28.For SQL
** Query to check pending qty in GRN "IC" same for Challan "OC"
** Syntax-----------------------------------------------------------------
SELECT S.branch, s.docdate, s.party, s.type, s.prefix, s.srl, s.sno, 
   s.code, s.qty, s.pending, s.qty - CASE WHEN SUM(a.qty) IS NULL 
   THEN 0 ELSE SUM(a.qty) END AS Pendqty
FROM stock S LEFT JOIN
   stock a ON 
   s.type + s.prefix + s.sno + s.srl = a.chlnnumber AND 
   s.branch = a.branch
WHERE s.branch = 'HO' AND s.subtype = 'IC'
GROUP BY S.branch, s.docdate, s.party, s.type, s.prefix, s.srl, s.sno, 
   s.code, s.qty, s.pending
HAVING s.pending <> (s.qty - CASE WHEN SUM(a.qty) IS NULL 
   THEN 0 ELSE SUM(a.qty) END)

---------------------------------------------------------------------------

29.For SQL
** Query to check pending amount in outstnding
** Syntax-----------------------------------------------------------------
SELECT S.branch, s.docdate, s.code, s.type, s.prefix, s.srl, s.sno, 
   s.flag, s.amount, s.pending, 
   s.amount - CASE WHEN SUM(a.amount) IS NULL 
   THEN 0 ELSE SUM(a.amount) END AS Pendamt
FROM (outstanding S LEFT JOIN
   outstanding a ON 
   s.type + s.prefix + s.sno + s.srl = a.type + a.prefix + a.sno + a.srl AND
    s.flag <> a.flag AND s.branch = a.branch)
   Left Join Master On Master.Code = s.Code And Master.Branch = s.Branch 
WHERE s.branch = 'HO' AND s.flag <> '' and master.basegr In('D','S') 
GROUP BY S.branch, s.docdate, s.code, s.type, s.prefix, s.srl, s.sno, 
   s.flag, s.amount, s.pending
HAVING s.pending <> (s.amount - CASE WHEN SUM(a.amount) 
   IS NULL THEN 0 ELSE SUM(a.amount) END)

---------------------------------------------------------------------------

30. Find out difference of Days from 2 Dates
e.g. Ageing Analysis, Days from Report Date to Invoice Date

~DatDiff{~RepEndDate{},~Col{4}}

----------------------------------------------------------------------------

31.find Duplicate Record 

  SELECT *
   FROM STOCK
  WHERE branch = 'HYDGEO' AND 
    BRANCH + PREFIX + TYPE + SRL + SNO =
        (SELECT BRANCH + PREFIX + TYPE + SRL + SNO
      FROM STOCK
      GROUP BY BRANCH + PREFIX + TYPE + SRL + SNO
      HAVING COUNT(BRANCH + PREFIX + TYPE + SRL + SNO) 
           > 1)
  ORDER BY TYPE, SRL

----------------------------------------------------------------------------

32.Search  single ( ' )In Database 

  SELECT     Name FROM  Master WHERE   (Name LIKE '%,%')

----------------------------------------------------------------------------

32.Due Date

    ~DayAdd{Sales.Docdate,sales.CrPeriod}

----------------------------------------------------------------------------

33.Records filtter in Report

   6|$|01/04/2004|D|---->6-Col No,$-Operator,01/04/2004-Value,D-DataType

----------------------------------------------------------------------------

34  Attach an SQL Database.txt

EXEC sp_attach_db @dbname = N'nTfatSet', 
   @filename1 = N'c:\MSSQL7\Data\Nature\nTfatSet.mdf', 
   @filename2 = N'c:\MSSQL7\Data\Nature\nTfatSet_log.ldf'

---------------------------------------------------------------------

35(A)Order Number in Sales (order to Dly note to Sales)
    ~STOREVAR{1,~DBSEEK{|stock|,|type+prefix+sno+srl|,|=|,stock.ChlnNumber,|OrdNumber|}}--Never Print
    ~GETVAR{1}----Never Print
    ~DBSEEK{|Orders|,|type+prefix+srl|,|=|,~LEFT{~GETVAR{1},11}~MID{~GETVAR{1},17},|OrdNumber|}---Print

  (B)OrderNumber in sales (order to sales)
     ~DBSEEK{|Orders|,|type+prefix+srl|,|=|,~LEFT{Stock.OrdNumber,11}~MID{Stock.OrdNumber,17},|OrdNumber|}

-----------------------------------------------------------------------

36 RecordLine Number in Report

  ~LineNo{}

-----------------------------------------------------------------------

37 Excise Amt in Register

~DbSeek{|Stockexcise|,|Type+Prefix+Srl|,|=|,~Col{1},|TotBEDAmt|}

-----------------------------------------------------------------------

38 cess Amt in Register

~DbSeek{|Stockexcise|,|Type+Prefix+Srl|,|=|,~Col{1},|TotCessAmt|}

-----------------------------------------------------------------------

39 Tax Form Name

~DBSEEK{|Taxmaster|,|code|,|+|,Sales.taxcode,|Formname|} or
~OpenRs{|TaxMaster|,|Code='|Sales.TaxCode|' And Scope='S'|,|FormName|}

----------------------------------------------------------------------

40 BatchNo and Qty Print in Doc.Design

 ~OpenRs{|StockBatch|,|Type='|Stock.Type|' And Prefix='|Stock.Prefix|' And Srl='|Stock.Srl|' And Sno='|Stock.Sno|'|,|Batch&'-'&Abs(Qty)|}

----------------------------------------------------------------------

41 Addon Details

~ADDONITEMS{|@D|,|Type='|QuoteStk.Type|' And Prefix='|QuoteStk.Prefix|' And Srl='|QuoteStk.Srl|' And Sno='|QuoteStk.Sno|'|,|B|,1,5}
~ADDONITEMS{Quote.SubType,|Type='|Quote.Type|' And Prefix='|Quote.Prefix|' And Srl='|Quote.Srl|'|,|B|,1,5}
* optional : H-Header, V-Value, B-Both
           : Field Range e.g. 1,5		

----------------------------------------------------------------------

42 Addon Head

~ADDONHEAD{|@D|,|F001|}

~ADDONHEAD{Quote.SubType,|F001|}

----------------------------------------------------------------------

43.Allocation in doc.Printing

~ALLOCATIONITEM{Code,Type,Prefix,Srl,Sno,|YYYYYYYYYYYYY|}
 Syntax - ~ALLOCATIONITEM{stock.Code,stock.Type,stock.Prefix,stock.Srl,stock.Sno,AllDft,|Option Y-RowHeader Y-RowDetail Y-RowTotal Y-RowWrapZero Y-ColHeader Y-ColDetail Y-ColTotal Y-ColWrapZero Y-MRP Y-MRPValue Y-Rate Y-Amount Y-PrintLine|}"

--Option----
 1. RowHeader 
 2. RowDetail 
 3. RowTotal 
 4. RowWrapZero 
 5. ColHeader 
 6. ColDetail 
 7. ColTotal 
 8. ColWrapZero 
 9. MRP 
10. MRPValue 
11. Rate 
12. Amount
13. PrintLine
--Y(Yes)/N(No) Print---
----------------------------------------------------------------------
e.g. 1. if <Sno> pass |-1| then it will collect all details from a particular vouchers
        (note : Item allocation parameters should be same)	
     2. AllDft is false if true is passed then if will collect all Dft Values	
----------------------------------------------------------------------
e.g. Printing Sequence
1.  |YYNNYNYYYNYYY|  - print only heading
2.  |YYYNNYYYYNYYY|  - print only details with total
3.  |YYNNNYYYYNYYY|  - print only details without total
4.  |YYYNNNYNYNYYY|  - print only total
5.  |YYYNYYYNYYYYY|  - print all
6.  |YNYYYYYYYNYYY|  - print only header with total (no column details)
7.  |YYYYYNYYYNYYY|  - print only header with total (no row details)

----------------------------------------------------------------------

44.Allocation in Reports
 Add Col. Heading	Col.Fld								Visible  Type
	----------      ---------               					---------------
	1.allocation---StockClass.allocation						----N---------Str
	2.xValue    ---StockClass.xvalue1   						----N---------Str
	3.Class Value--StockClass.Classvalue						----Y---------Str
	4.Fld        --StockClass.Fld       						----N---------Str
	5.Qty	     --StockClass.Qty	    						----Y---------Qty
	6.SetcolValue- ~Setcolvalue{~col{StockClass.Qty},~col{StockClass.xValue},|Sr^ColHeading|}
        E.g-~SetColValue{~Col{13},~Col{10},|15^15%20^16%30^17%40^18%50^19%XS^20%S^21%M^22%L^23%XL^24%XXL^25|}
	7.Clo.Heading(Value)

-----------------------------------------------------------------------------------------------------------------

45.Account Balance

	~ACCBALANCE{Code,Date} e.g-~ACCBALANCE{sALES.CODE,DATE}

----------------------------------------------------------------------

46.DlySchedule in MultiParty Order
   Add Col.
   1.Srl--OrdersStk.Type+OrdersStk.Prefix+OrdersStk.Srl+OrdersStk.Sno
   2.Dly. Schedule--~OpenRs{|DlySchedule|,|Type+Prefix+Srl+Sno='|~Col{9}|'|,|DlyDate|}
   3.Dly,Qty--~OpenRs{|DlySchedule|,|Type+Prefix+Srl+Sno='|~Col{9}|'|,|Qty|}

-------------------------------------------------------------------------------------------------------

47.TDS Amt in Purchase Stock Register

    ~Dbseek{|Purchase|,|Type+Prefix+srl|,|=|,~Col{2}~col{3}~col{4},|TdsAmt|}
---------------------------------------------------------------------------------------------------------

48. Item code in View Data

    ~DBSEEK{|Stock|,|Stock.Type+Stock.srl|,|=|,~Col{2}~col{3},|Code|}

--------------------------------------------------------------------------------------------------------

49.MonthYear in Register(SQL)--Report summary

   LEFT(CONVERT(CHAR,Sales.Docdate,100),3) + ' ' + CAST(Year(Sales.Docdate) AS CHAR(4))

----------------------------------------------------------------------------------------------

50.Weekly in Register-Report summary

   CASE WHEN CHARINDEX(CONVERT(CHAR,(datediff(d,'xmain.gdtStartDate',Purchase.Docdate)+1)/7),'.')<>0 THEN
((datediff(d,'xmain.gdtStartDate',Purchase.Docdate)+1)/7)+1 ELSE ((datediff(d,'xmain.gdtStartDate',Purchase.Docdate)+1)/7) END

----------------------------------------------------------------------------------------------

51.Fortnightly in Regisetr-Report summary

   CASE WHEN CHARINDEX(CONVERT(CHAR,(datediff(d,'xmain.gdtStartDate',Purchase.Docdate)+1)/14),'.')<>0 THEN    
(((datediff(d,'xmain.gdtStartDate',Purchase.Docdate)+1)/14)+1)
ELSE 
((datediff(d,'xmain.gdtStartDate',Purchase.Docdate)+1)/14) END

----------------------------------------------------------------------------------------------

52.Check Ledger debit & credit balances
  1.	Select SUM(DEBIT) AS D, SUM(CREDIT) AS C , SUM(DEBIT-CREDIT) AS B from ledger  
  2.	Select TYPE, SUM(DEBIT) AS D, SUM(CREDIT) AS C , SUM(DEBIT-CREDIT) AS B from ledger  group BY TYPE 
  3.	SELECT * FROM LEDGER WHERE type = 'SAL' AND BRANCH+MAINTYPE+SUBTYPE+TYPE+PREFIX+SRL IN(Select BRANCH+MAINTYPE+SUBTYPE+TYPE+PREFIX+SRL from ledger WHERE type = 'SAL' group byBRANCH,MAINTYPE,SUBTYPE,TYPE,PREFIX,SRL HAVING sum(debit) <> sum(credit) ) ORDER BY BRANCH,MAINTYPE,SUBTYPE,TYPE,PREFIX, SRL,SNO

----------------------------------------------------------------------------------------------

53.DEL.ADDRESS IN GOODS DELIVERY

  COL12- Stock.OrdNumber
~DbSeek{|Orders|,|Type+Prefix+Srl|,|=|,~Left{Stock.OrdNumber,11}||~Mid{Stock.OrdNumber,17,6},|DlyAddress|}

----------------------------------------------------------------------------------------------

54,Multiple tax Print in doc Design(Summary)

  Tax Code-------- ~TaxDetails{0,0}
  Tax Name-------- ~TaxDetails{0,1}
  Taxable -------- ~TaxDetails{0,2}	
  Tax Amount------ ~TaxDetails{0,3}
  Tax Surcharge--- ~TaxDetails{0,4}
  Add.Surcharge--- ~TaxDetails{0,5}
	        -- ~TaxDetails{0,6}
  Add.Tax1      -- ~TaxDetails{0,7}
  Add.Tax2      -- ~TaxDetails{0,8}
  Sno no.	-- ~TaxDetails{0,9}
  Serial no.-- ~TaxDetails{0,10}

  DiscDetail%   	--~DiscDetails{0,0}
  DiscAmt	--~DiscDetails{0,1}
  itemSno      	--~DiscDetails{0,2}  

----------------------------------------------------------------------------------------------

55.Stock Statement Formate-For Advance Statement

  Code
  Name
  Grp
  GrpName
  Unit
' Opening
' Opening2
' Rec
' Rec2 - second qty
' Ret  - Sales Returns
' Ret2
' Issue
' Issue2
' Balance
' Balance2
' Rate
' Itemvalue
' cAvgRate

-----------------------------------------------------------------------

56 Ad.Tax Description,Tax Name
    
   ~OpenRs{|TaxMaster|,|Code='|Sales.TaxCode|'|,|Adescr|}

-----------------------------------------------------------------------   	

57.Store Stock in Order Status

 Co.Field-------~GetStock{~Col{6},,,,,,|100001|}
 Condition------ ~Col{10<>0}

----------------------------------------------------------------------------------------------

58.Second Qty/Rate in Sales Invoice

~abs{~iif{stock.rateon>=0,stock.Qty2,Stock.Qty}}

   ~iif{stock.rateon>=1,stock.unit2,Stock.unit}

----------------------------------------------------------------------------------------------

59.Invoice no and date in Order Dly Schedule Report

 invoice No:--- ~OpenRs{|Stock|,|OrdNumber='|~Col{2}|' Order By Srl|,|Abs(Stock.srl)|}
 invoice Date-- ~OpenRs{|Stock|,|OrdNumber='|~Col{2}|' Order By Srl|,|Stock.DocDate|}
 invoice Qty -- ~OpenRs{|Stock|,|OrdNumber='|~Col{2}|' Order By Srl|,|Abs(Stock.Qty)|}

--------------------------------------------------------------------------------

60

update sales set taxcode=(select taxcode from stock where stock.firstsno<>0 and sales.type+sales.prefix+sales.srl=stock.type+stock.prefix+stock.srl and sales.branch=stock.branch)

--------------------------------------------------------------------------------

61. Get the pending Sales/Purchase Order of a product

~GetOrders{Product,Date,Party,Branch,|OP or OS|}
example:
~GetOrders{~Col{1},|00:00:00|,,,|OP|} for Purchase Order
~GetOrders{~Col{1},|00:00:00|,,,|OS|} for Sales Order

where ~Col{1} - contains the product code

-----------------------------------------------------------------------

63.Double record to Single Record in database.
   Creat New Table For Double Record to Single Record

   Select Distinct * into xmaster from master

-------------------------------------------------------------------------------------------

64. Split Product Master/Master After any character (example #)

to take part of a product description from the left of first instance of '#'
   I) ~Left{ItemMaster.Name,~AT{ItemMaster.Name,|#|}-1}

to take part of a product description after the first instance of '#'
   II) ~Mid{ItemMaster.Name,~AT{ItemMaster.Name,|#|}+1}

 Example: Product Name-->Floppy.Box 

   I) Floppy
  II) Box

------------------------------------------------------------------------
65.SET RELETION QUERY


ACCESS-
UPDATE    Outstanding,master
SET         Outstanding.Broker = master.broker
WHERE     (outstanding.Code = master.code)


SQL---

UPDATE    Outstanding
SET              Broker =
                          (SELECT     BROKER
                            FROM          MASTER
                            WHERE      MASTER.CODE = OUTSTANDING.CODE)

-----------------------------------------------------------------------
66 Find out difference of Days from 2 Dates
e.g. Ageing Analysis, Days from Report Date to Invoice Date

~DatDiff{~RepEndDate{},~Col{4}}
-----------------------------------------------------------------------------------------------
67.J.B.FOODS SALES INVOICE FORMAT

PRESS CTRL+SHIFT+F

BASE TABLE NAME =  STOCKCLASS

FILTER ON       =  stockclass.qty<>0 and stockclass.allocation='size'

FLAVOUR & SIZE FIELD EQUATION (FLAVOURS)

STOCKCLASS.CLASSVALUE

~DBSEEK{|stockclass|,|type+prefix+srl+sno+cast(fld as varchar)+allocation|,|=|,stockclass.type||stockclass.prefix||stockclass.srl||stockclass.sno||stockclass.fld|FLAVOURS|,|ClassValue|}

STOCKCLASS.QTY
STOCKCLASS.RATE
---------------------------------------------------------------------------------------------------
68.Total of Particular col.

   ~mTotal{|Amount|}----------->Ex.~mTotal{|Text|}

   Condition------->LastProduct=|true| 
-------------------------------------------------------------------------------------------------------
69. user name 
   ~storevar{1,Orders.UserID}
  ~DbFind{|tfatpass.|,|ids|,|=|,~getvar{1},|Name|}
------------------------------------------------------------------------------------------------------------
70.Convert Touchvalue to Date

   1)Left(Cast(Sales.TouchValue as VarChar),8)
   2)~right{~Col{11},2}|-|~mid{~Col{11},5,2}|-|~Left{~Col{11},4}
---------------------------------------------------------------------------------------------------------
71.Set value of one row to another
	~SetText{RowDiff,ColDiff,Value}
----------------------------------------------------------------------------------------------------------
72.	~GetText{RowDiff,ColDiff}
----------------------------------------------------------------------------------------------------------
73.	~SETCOLVALUE{Value,Cond.Expression,|condvalue^col%condvalue^col|}
                    ' VALUE           = The value to be filled    e.g. ~Col{3} - value of col3
                    ' cond.expression = the value of cond.        e.g. ~Col{5} - col5 has multiple options
                    ' condvalue       = result of col5 if matching then fill the VALUE in
                    ' ^Col            = result of col5 if matching then fill the VALUE in this column
-----------------------------------------------------------------------------------------------------------
74. TO PRINT CITY IN VOUCHER 
	~DBSEEK{|TFATCITY|,|Code|,|=|,TfatBranch.aCity,|Name|,|N|}
-----------------------------------------------------------------------------
75.PRINT BILLNUMBER AND BILLDATE IN PAYMENT VOUCHER

~storevar{1,~DBSEEK{|LEDGER|,|Code|,|=|,Ledger.AltCode,|BillDate|}}
~GETVAR{1}
--------------------------------------------------------------------------------
76.Addon in sales REGISER
	~DbSeek{|AddonRS|,|Type+Prefix+Srl|,|=|,~Col{2}~Col{3}~Col{4},|F005|}
----------------------------------------------------------------------------------------------------------------------

77.EXCISE DETAILOF ALTERNATE ADDRESS IN DESIGN PRINTING
	~DBSEEK{|ExciseDetails|,|Code+CAST(SNO AS VARCHAR)|,|=|,Sales.CODE+Sales.AltAddress,|RANGE|}
-----------------------------------------------------------------------------------------------------------------------------
78 Balance Confirmation Print Oreder by Date
    Correnseponence Document ----> Format--->Format setup ---->ctl + Shift + F-->Group By --> DDate
----------------------------------------------------------------------------------------------------------------------------------------------
79.SUMFIELD EXAMPLE
	~sumfield{|stockexcise|,|assamt|,|code='|~Col{2}|' and docdate<='|~Col{24}|' and docdate>='|~Col{23}|'|}

80.Exclude tax amount from rate

	rate*11.1/100---12.5%
	rate*3.85/100---4%
--------------------------------------------------------------------------------------------------------
81.Print Report Heading--Report Print

	Default Report Format->USERHEADING
	
82.Print Defaul address in doc.print

~OpenRs{|Address|,|code='|master.code|' And sno='|master.dftaddress|' And branch='|master.branch|'|,|adrl1|}


83 Account Opening balance in Report

~Getbalance{~col{1},2}-----  ~col{1}-Account code
                    
                    ' e.g. GetBalance{~Col{1}} : Balance as on repdate1 - 1 = opening
                    ' e.g. GetBalance{~Col{1},1,0} : Balance as on repdate1 - 1 = opening
                    ' e.g. GetBalance{~Col{1},1,1} : Balance as on repdate1 balance including the first day
                    ' e.g. GetBalance{~Col{1},2,0} : Balance as on repdate2 - 1 = Closing -1
                    ' e.g. GetBalance{~Col{1},2,1} : Balance as on repdate2 = closing
----------------------------------------------------------------------------------------------
84 How to get value without using ~DBSeek{}

   isnull((Select Top 1 Batch from StockBatch Where StockBatch.Type=Stock.Type And StockBatch.Prefix=Stock.Prefix And StockBatch.Srl=Stock.Srl And StockBatch.Sno=Stock.Sno And StockBatch.Branch=Stock.Branch),'')

----------------------------------------------------------------------------------------------------------
85 Auto Charges Printing in Body section
For Description
Equation...... ~AutoUdc{D} Condition......LastProduct=|True| and Click words Wrap
For Value
Equation...... ~AutoUdc{V} Condition......LastProduct=|True| and Click words Wrap
In Charges setting tick mark in Auto Print Document
------------------------------------------------------------------------
86 Auto Charges Printing in Footer Section
For Description
Equation...... ~AutoUdc{D} and Click words Wrap
For Value
Equation...... ~AutoUdc{V} and Click words Wrap

In Charges setting tick mark in Auto Print Document
--------------------------------------------------------------------------------------
87.Trading Excise Invoice Formate [ Body Option Slit ]
~redetail{start}
~redetail{end}
----------------------------------------------------------------------------------------------------------------
88. Ledger total
ledgertotal
----------------------------------------------------------------------------------------------
88. In Condition

ledgertotal in |9197.00,40000.00|

89. GetOSAdj
   to Print Type
   ~GETOSADJ{Ledger.Type,Ledger.Prefix,Ledger.Srl,Ledger.Sno,Ledger.Code,|Type|,|Type|} 	
    1) Type
    2) Prefix
    3) Srl  	
    4) Sno
    5) Code
    6) What to print [Type, Prefix , Serial, BillNumber ,BillDate ,BillAmount, Amount,Pending,Sno]
    7) Print Header  [Type.....}

to print Bill Amount    With Header
   ~GETOSADJ{Ledger.Type,Ledger.Prefix,Ledger.Srl,Ledger.Sno,Ledger.Code,|BillAmount|,|BILL AMOUNT|}

to print Bill Amount    With Out Header
   ~GETOSADJ{Ledger.Type,Ledger.Prefix,Ledger.Srl,Ledger.Sno,Ledger.Code,|BillAmount|}

Note : 1) Set Field Property Auto Height [Word Wrap], 
       2) Do Not set It as Numeric Field
       3) To Print 1,2,3 in List Set Print Args to Sno 
         





'' pharma license stock update

 
 UPDATE StockLicense SET PendingAmt =0,PendingQty =0 WHERE SubType ='LP'
 
 UPDATE InventA Set InventA.PendingQty = ABS(IsNull(InventA.Qty,0)) - Abs(IsNull(InvSal.Qty,0)),  InventA.PendingAmt = ABS(IsNull(InventA.Amt,0)) - Abs(IsNull(InvSal.Amt,0))  
 FROM  StockLicense InventA INNER JOIN   (
 SELECT  atype,aprefix,asno,aSno1, aserial , LicenseNo, Sum(Qty) As Qty ,Sum(Amt) as Amt  from  StockLicense   WHERE SubType <>'LP'  Group by atype,aprefix,asno,aSno1, aserial,LicenseNo 
 )     As InvSal  ON  InventA.Type =InvSal.aType AND  InventA.Prefix = InvSal.aPrefix AND InventA.Sno = InvSal.aSno AND InventA.Sno1 = InvSal.aSno1  AND InventA.Srl = InvSal.aSerial AND InventA.LicenseNo = InvSal.LicenseNo  AND InventA.Branch ='HO0000' 
 WHERE InventA.SubType ='LP'
